Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Determine  If  the  Number  of  Files  in  a  Series  of  Folders  Exceeds  a  Specified  Value  

 Content of Determine If the Number of Files in a Series of Folders Exceeds a Specified Value.vbs
MD5 Hash: 10B69DCF8FF552A1604C799079D23488
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colSubfolders = objWMIService.ExecQuery _
("Associators of {Win32_Directory.Name='C:\Absentee Reports'} " _
& "Where AssocClass = Win32_Subdirectory " _
& "ResultRole = PartComponent")

For Each objFolder in colSubfolders
Set colFiles = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='" & objFolder.Name & "'} Where " _
& "ResultClass = CIM_DataFile")

If colFiles.Count => 4 Then
Select Case colFiles.Count
Case 4
Wscript.Echo objFolder.Name & " has 4 files in it."
Case 5
Wscript.Echo objFolder.Name & " has 5 files in it."
Case 6
Wscript.Echo objFolder.Name & " has 6 files in it."
Case 7
Wscript.Echo objFolder.Name & " has 7 files in it."
Case 8
Wscript.Echo objFolder.Name & " has 8 files in it."
End Select
End If
Next



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a